#include "updateathlete.h"
#include "ui_updateathlete.h"

updateAthlete::updateAthlete(QWidget* parent)
    : QDialog(parent)
    , ui(new Ui::updateAthlete)
{
    ui->setupUi(this);

    this->setWindowTitle("修改运动员信息");
    this->setWindowFlags(Qt::WindowCloseButtonHint);
}

updateAthlete::~updateAthlete()
{
    delete ui;
}

QString updateAthlete::getAthleteName()
{
    return m_athleteName;
}

QString updateAthlete::getCode()
{
    return m_code;
}

QString updateAthlete::getMedalDate()
{
    return m_medalDate;
}

QString updateAthlete::getMedalLevel()
{
    return m_medalLevel;
}

QString updateAthlete::getEventName()
{
    return m_eventName;
}

QString updateAthlete::getScore()
{
    return m_score;
}

QString updateAthlete::getCountryName()
{
    return m_country_name;
}

void updateAthlete::setAthleteName(QString name)
{
    ui->lineEdit->setText(name);
}

void updateAthlete::setCountryName(QString name)
{
    ui->lineEdit_7->setText(name);
}

void updateAthlete::on_pushButton_clicked()
{
    m_athleteName = ui->lineEdit->text();
    m_code = ui->lineEdit_2->text();
    m_medalDate = ui->lineEdit_4->text();
    m_medalLevel = ui->lineEdit_3->text();
    m_eventName = ui->lineEdit_5->text();
    m_score = ui->lineEdit_6->text();
    m_country_name = ui->lineEdit_7->text();

    this->accept();
}

void updateAthlete::on_pushButton_2_clicked()
{
    this->reject();
}

